package com.example.designpartten.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;

/**
 * @author hql
 * @date 2020/4/13 17:25
 */
@Slf4j
public  class Handler {

    private Handler nextHandler;

    public void setNextHandler(Handler nextHandler) {
        this.nextHandler = nextHandler;
    }

    public void getResponse(String name) {
        if(StringUtils.isEmpty(name)) {
            log.info("姓名是空！");
        } else if(this.nextHandler != null) {
            log.info("没办法，我没权限操作，只能到下个节点去了！");
            this.nextHandler.getResponse(name);
        } else {
            log.info("到底了，没有流程走了！");
        }
    }

}
